<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ include file="../../base.jsp" %>
<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>数据 - AdminLTE2定制版</title>
    <meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 页面meta /-->
</head>
<script>
    function save() {
        var packingListId = getCheckId();
        if (packingListId) {
            //提交表单
            document.getElementById("editForm").submit();
        } else {
            alert("请勾选装箱单信息，且每次只能勾选一个")
        }
    }
</script>
<div id="frameContent" class="content-wrapper" style="margin-left:0px;">
    <!-- 内容头部 -->
    <section class="content-header">
        <h1>
            委托管理
            <small>新增委托单</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="all-admin-index.html"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="all-order-manage-list.html">委托管理</a></li>
            <li class="active">新增委托单及装箱单列表</li>
        </ol>
    </section>
    <!-- 内容头部 /-->
    <!-- 正文区域 -->


    <!--订单信息-->

    <form id="editForm" action="/cargo/shipping/addShippering.do" method="post">
        <div class="row data-type" style="margin: 0px">


            <div class="col-md-2 title">货主</div>
            <div class="col-md-4 data">
                <input type="text" class="form-control" placeholder="货主" name="shipper"
                       value="${shippingOrder.shipper}">
            </div>

            <div class="col-md-2 title">提单抬头</div>
            <div class="col-md-4 data">
                <input type="text" class="form-control" placeholder="提单抬头" name="consignee"
                       value="${shippingOrder.consignee}">
            </div>

            <div class="col-md-2 title">正本通知人</div>
            <div class="col-md-4 data">
                <input type="text" class="form-control" placeholder="正本通知人" name="notifyParty"
                       value="${shippingOrder.notifyParty}">
            </div>

            <div class="col-md-2 title">运输方式</div>
            <div class="col-md-4 data">
                <div class="form-group form-inline">
                    <div class="radio"><label><input type="radio" ${shippingOrder.orderType=="海运"?'checked':''}
                                                     name="orderType" value="海运">海运</label></div>
                    <div class="radio"><label><input type="radio" ${shippingOrder.orderType=="空运"?'checked':''}
                                                     name="orderType" value="空运">空运</label></div>
                </div>
            </div>

            <div class="col-md-2 title">装运港</div>
            <div class="col-md-4 data">
                <input type="text" class="form-control" placeholder="装运港" name="portOfLoading"
                       value="${shippingOrder.portOfLoading}">
            </div>

            <div class="col-md-2 title">转船港</div>
            <div class="col-md-4 data">
                <input type="text" class="form-control" placeholder="转船港" name="portOfTrans"
                       value="${shippingOrder.portOfTrans}">
            </div>
            <div class="col-md-2 title">卸货港</div>
            <div class="col-md-4 data">
                <input type="text" class="form-control" placeholder="卸货港" name="portOfDischarge"
                       value="${shippingOrder.portOfDischarge}">
            </div>
            <div class="col-md-2 title">装期</div>
            <div class="col-md-4 data">
                <div class="input-group date">
                    <div class="input-group-addon">
                        <i class="fa fa-calendar"></i>
                    </div>
                    <input type="text" placeholder="装期" name="loadingDate" class="form-control pull-right"
                           value="<fmt:formatDate value="${shippingOrder.loadingDate}" pattern="yyyy-MM-dd"/>"
                           id="loadingDate">
                </div>
            </div>

            <div class="col-md-2 title">效期</div>
            <div class="col-md-4 data">
                <div class="input-group date">
                    <div class="input-group-addon">
                        <i class="fa fa-calendar"></i>
                    </div>
                    <input type="text" placeholder="效期" name="limitDate" class="form-control pull-right"
                           value="<fmt:formatDate value="${shippingOrder.limitDate}" pattern="yyyy-MM-dd"/>"
                           id="limitDate">
                </div>
            </div>

            <div class="col-md-2 title">是否分批</div>
            <div class="col-md-4 data">
                <div class="form-group form-inline">
                    <div class="radio"><label><input type="radio" ${shippingOrder.isBatch=="是"?'checked':''}
                                                     name="isBatch" value="是">是</label></div>
                    <div class="radio"><label><input type="radio" ${shippingOrder.isBatch=="否"?'checked':''}
                                                     name="isBatch" value="否">否</label></div>
                </div>
            </div>
            <div class="col-md-2 title">是否转船</div>
            <div class="col-md-4 data">
                <div class="form-group form-inline">
                    <div class="radio"><label><input type="radio" ${shippingOrder.isTrans=="是"?'checked':''}
                                                     name="isTrans" value="是">是</label></div>
                    <div class="radio"><label><input type="radio" ${shippingOrder.isTrans=="否"?'checked':''}
                                                     name="isTrans" value="否">否</label></div>
                </div>
            </div>

            <div class="col-md-2 title">份数</div>
            <div class="col-md-4 data">
                <input type="text" class="form-control" placeholder="份数" name="copyNum"
                       value="${shippingOrder.copyNum}">
            </div>
            <div class="col-md-2 title">扼要说明</div>
            <div class="col-md-4 data">
                <input type="text" class="form-control" placeholder="扼要说明" name="remark"
                       value="${shippingOrder.remark}">
            </div>
            <div class="col-md-2 title">运输要求</div>
            <div class="col-md-4 data">
                <input type="text" class="form-control" placeholder="运输要求" name="specialCondition"
                       value="${shippingOrder.specialCondition}">
            </div>
            <div class="col-md-2 title">运费</div>
            <div class="col-md-4 data">
                <input type="text" class="form-control" placeholder="运费" name="freight"
                       value="${shippingOrder.freight}">
            </div>
            <div class="col-md-2 title">复核人</div>
            <div class="col-md-4 data">
                <input type="text" class="form-control" placeholder="复核人" name="checkBy"
                       value="${shippingOrder.checkBy}">
            </div>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading">新增委托单</div>
        </div>
        <!--订单信息/-->

        <!--工具栏-->
        <div class="box-tools text-center">
            <button type="button" onclick='save()' class="btn bg-maroon">保存</button>
            <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
        </div>
        <!--工具栏/-->
        <!-- 正文区域 /-->

        <div class="content">
            <!-- .box-body -->
            <section class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">装箱单列表</h3>
                </div>

                <div class="box-body">

                    <!-- 数据表格 -->
                    <div class="table-box">
                        <!--数据列表-->
                        <table id="dataList" class="table table-bordered table-striped table-hover dataTable">
                            <thead>
                            <tr>
                                <td class="tableHeader"><input type="checkbox" name="selid"
                                                               onclick="checkAll('id',this)">
                                </td>
                                <th class="sorting">序号</th>
                                <th class="sorting">装箱单号</th>
                                <th class="sorting">卖方</th>
                                <th class="sorting">买方</th>
                                <th class="sorting">发票号</th>
                                <th class="sorting">发票日期</th>
                                <%--<th class="sorting">唛头</th>--%>
                                <th class="sorting">描述</th>
                                <th class="sorting">状态</th>
                                <th class="text-center">操作</th>
                            </tr>
                            </thead>
                            <tbody class="tableBody">
                            ${links }
                            <c:forEach items="${page.list}" var="o" varStatus="status">
                                <tr class="odd" onmouseover="this.className='highlight'"
                                    onmouseout="this.className='odd'">
                                    <td><input type="checkbox" name="shippingOrderId" value="${o.packingListId}"/></td>
                                        <%--<input type="text" id="packingListId" name="packingListId" value="${o.packingListId}"/>--%>
                                    <td>${status.index+1}</td>
                                    <td>${o.packingListId }</td>
                                    <td>${o.seller }</td>
                                    <td>${o.buyer}</td>
                                    <td>${o.invoiceNo}</td>
                                    <td><fmt:formatDate value="${o.invoiceDate}" pattern="yyyy-MM-dd"/></td>
                                    <td>${o.descriptions}</td>
                                    <td>
                                        <c:if test="${o.state==2}"><font color="red">已装船</font></c:if>
                                        <c:if test="${o.state==1}"><font color="red">已报运</font></c:if>
                                    </td>
                                    <td>
                                        <a href="${ctx }/cargo/packing/toView.do?id=${o.packingListId}">[查看]</a>
                                            <%--<c:if test="${o.state==1}">
                                                <a href="/cargo/packing/packingPdf.do?id=${o.packingListId}">[下载]</a>
                                            </c:if>--%>
                                    </td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>

                        <!--数据列表/-->
                        <!--工具栏/-->
                    </div>
                    <!-- 数据表格 /-->
                </div>
                <%--<div class="box-footer">
                    <jsp:include page="../../common/page.jsp">
                        <jsp:param value="/cargo/packing/list.do" name="pageUrl"/>
                    </jsp:include>
                </div>--%>
                <div class="box-footer">
                    <jsp:include page="../../common/page.jsp">
                        <jsp:param value="/cargo/packing/list.do" name="pageUrl"/>
                    </jsp:include>
                </div>
            </section>
        </div>
    </form>

</div>
</section>
</div>
<!-- 内容区域 /-->
</body>
<script src="../../plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="../../plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<link rel="stylesheet" href="../../css/style.css">
<script>
    $('#loadingDate').datepicker({
        autoclose: true,
        format: 'yyyy-mm-dd'
    });
    $('#limitDate').datepicker({
        autoclose: true,
        format: 'yyyy-mm-dd'
    });
</script>
</html>